using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using LocalBoard.Domain;

namespace LocalBoard.Web
{
	public partial class CreateBoard : DefaultClubPage
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			string name = Request.Params["name"];
			string placeName = Request.Params["place"];
			string address = Request.Params["address"];
			string lat = Request.Params["lat"];
			string lng = Request.Params["lng"];
			Board board = new Board(name, null, 0, 0, ClubController.ClubId, BoardViewType.List);
			board.PlaceName = placeName != null ? placeName : "";
			board.Address = address != null ? address : "";
			board.Latitude = lat != null ? lat : "";
			board.Longitude = lng != null ? lng : "";
			int boardId = ClubController.CreateBoard(board);
			Response.Clear();
			Response.Write(boardId.ToString());
			Response.End();
		}
	}
}